<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>点击穿透</title>
    <style>
        .container{
            height: 100%;
        }
        .mask{
            position:absolute;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            left: 0;
            top: 0;
            padding-left: 150px;
            padding-top: 100px;
            color: white;
        }

        .mask p{
            color: white;
        }
        #banner{
            width: 100%;
            height: 300px;
            background: rgb(221, 82, 82);
        }
    </style>
</head>
<body>
    <div class="container">
        <a href="http://atguigu.com"><div id="banner">我是 banner 内容</div></a>
        <div class="mask">
            <p>恭喜恭喜 中奖啦</p>
            <button>点击关闭</button>
        </div>
    </div>

    <script>
        let btn = document.querySelector('button');
        let mask = document.querySelector('.mask');

        //绑定事件
        btn.addEventListener('touchstart', function(){
            setTimeout(() => {
                //隐藏遮罩层 延时
                mask.style.display = 'none';
            }, 100)
        });

    </script>
</body>
</html>